Optical detection device

ABSTRACT

An optical detection device of detecting a target container includes a linear light source, an optical sensor array and a processor. The linear light source is adapted to project a long strip illumination beam onto the target container. The optical sensor array includes a plurality of sensing units arranged as a long strip adapted to receive a long strip detection beam reflected from the target container. The processor is electrically connected to the optical sensor array. The processor is adapted to analyze intensity distribution of the plurality of sensing units to acquire a relative distance between the optical sensor array and a rim of the target container.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to an optical detection device, and moreparticularly, to an optical detection device of detecting a targetcontainer.

2. Description of the Prior Art

The conventional water dispenser cannot detect an elevation of watersurface in the container. The user watches the container and controlsthe button of water dispenser to prevent the water from leakage. Theconventional coffee mater may be able to detect whether the container isput in the right position via the proximity sensor or the ultrasonicsensor; however, the proximity sensor and the ultrasonic sensor cannotdetect volume of the container and the liquid surface in the container.Thus, design of a liquid detection device of detecting the volume of thecontainer and the liquid surface in the container via the opticaldetection technique for increasing functions of the water dispenser andthe coffee maker is an important issue of the related industry.

SUMMARY OF THE INVENTION

The present invention provides an optical detection device of detectinga target container for solving above drawbacks.

According to the claimed invention, an optical detection device ofdetecting a target container is disclosed. The optical detection deviceincludes a linear light source, an optical sensor array and a processor.The linear light source is adapted to project a long strip illuminationbeam onto the target container. The optical sensor array includes aplurality of sensing units arranged as a long strip adapted to receive along strip detection beam reflected from the target container. Theprocessor is electrically connected to the optical sensor array. Theprocessor is adapted to analyze intensity distribution of the pluralityof sensing units to acquire a relative distance between the opticalsensor array and a rim of the target container.

According to the claimed invention, the long strip detection beam isdivided into a plurality of segments respectively reflected from aplurality of sections of the target container and received by theplurality of sensing units. The processor further analyzes intensity ofthe plurality of segments to compute distance variation of the opticalsensor array relative to the plurality of sections for acquiring acontour about the plurality of sections. The processor further analyzesthe contour about the plurality of sections to acquire depth variationinformation inside the rim, and determines whether an extra object is inliquid matter inside the target container according to the depthvariation information. The distance variation represents a plurality ofrelative distances between each section and one corresponding sensingunit.

According to the claimed invention, the processor divides the intensitydistribution at least into a first region with a maximal intensitycomputed value and a second region with a minimal intensity computedvalue, and analyzes the first region and the second region to determinea height of the target container via height difference between the rimand a plane whereon the target container is located. The processorfurther divides the intensity distribution into the first region, thesecond region and a third region with an intensity computed value rangedbetween the maximal intensity computed value and the minimal intensitycomputed value, and the processor further analyzes the third region todetermine a residual capacity of the target container via heightdifference between the rim and a base of the target container.

According to the claimed invention, the processor further analyzesintensity difference between the plurality of sections to find out oneor some sections with unusual optical parameters, defines the sectionswith the unusual optical parameters as a base of the target container,and utilizes the sections with the unusual optical parameters todetermine a residual capacity of the target container.

According to the claimed invention, the optical detection device furtherincludes a memory electrically connected to the processor and adapted tostore optical parameters of liquid matter. The processor is furtheradapted to compute a relative distance between the optical sensor arrayand the liquid matter inside the target container via analysis of theintensity distribution and compensation of the optical parameters. Theprocessor further analyzes image transformed by the intensitydistribution to determine a value range of the optical parameters viageometric center information of the image, for ensuring a category ofthe liquid matter. The optical parameters are a group consisted of areflective index, a refractive index and an absorption rate. An openingof the target container is surrounded by the rim and oriented to theoptical sensor array, the liquid matter is accommodated inside thetarget container and exposed via the opening.

According to the claimed invention, the processor further distinguishesthe rim from a base of the target container, and computes a diameter ofthe rim via the relative distance between the optical sensor array andthe rim. An alignment point is a vertically projected point from theoptical sensor array onto a surface of the rim. The processor analyzes afield of view of the optical sensor array to acquire a field intervalbetween the alignment point and a boundary of the field of view, andutilizes the field interval to compute a rim interval between thealignment point and the rim so as to accordingly acquire the diameter.

According to the claimed invention, the optical detection device furtherincludes a pressure sensor electrically connected to the processor andadapted to detect a weight of the target container. The processoranalyzes relation between the diameter and density and weight of liquidmatter inside the target container, to acquire a height of the liquidmatter. The processor utilizes the optical sensor array to detect aheight of liquid matter inside the target container when the weight isincreased and the height of the liquid matter is raised, and furtherutilizes the pressure sensor and the optical sensor array to detect theheight of the liquid matter when the weight is increased but the heightof the liquid matter is constant.

According to the claimed invention, the linear light source includes onestrip-formed lighting unit adapted to generate the long stripillumination beam. The linear light source includes a plurality oflighting units arranged side by side and adapted to generate the longstrip illumination beam. The optical sensor array is a M×1 matrix and Mis a positive integer numeral, or a M×N matrix and M and N are positiveinteger numerals.

According to the claimed invention, the optical detection device furtherincludes a rotation motor adapted to hold and rotate the linear lightsource or the target container for scanning the target container, or theoptical detection device further includes a shifting motor adapted tohold and shift the linear light source or the target container forscanning the target container.

According to the claimed invention, an optical detection device ofdetecting a target container is disclosed. The optical detection deviceincludes a light source, an optical sensor array and a processor. Thelight source is adapted to project an illumination beam onto the targetcontainer. The optical sensor array is adapted to receive a detectionbeam reflected from the target container. The processor is electricallyconnected to the optical sensor array. The processor is adapted toanalyze intensity distribution of the detection beam to acquire at leasttwo first intensity regions, and compute a radial dimension of thetarget container according to an interval between the at least two firstintensity regions.

According to the claimed invention, an optical detection device ofdetecting a target container is disclosed. The optical detection deviceincludes a first linear light source, a second linear light source, anoptical sensor array and a processor. The first linear light source isadapted to project a first long strip illumination beam onto the targetcontainer. The second linear light source is adapted to project a secondlong strip illumination beam onto the target container, and the secondlong strip illumination beam is crossed with the first long stripillumination beam. The optical sensor array is adapted to receive afirst long strip detection beam and a second long strip detection beamreflected from the target container. The processor is electricallyconnected to the optical sensor array. The processor is adapted toanalyze intensity distribution of the first long strip detection beamand the second long strip detection beam to acquire a relative distancebetween the optical sensor array and the target container.

The optical detection device of the present invention can utilize theimage about the target container and the plane illuminated by the linearlight source or the spot light source to determine the height and thediameter of the target container. If the optical parameters (such as thereflective index, the refractive index and the absorption rate) of theliquid matter in the target container are known, the optical parameterscan be utilized to compensate and compute the correct height of theinjected liquid matter in the target container. Moreover, the opticaldetection device may utilize the pressure sensor to detect the increasedweight of the injected liquid matter in the target container, and thenutilize pixel numbers of the optical sensor array and the height of theoptical sensor array relative to the rim of the target container toacquire the diameter of the target container, so as to compute theheight of the injected liquid matter in the target container viaanalysis of the increased weight and the density of the injected liquidmatter and the diameter of the target container.

The optical sensor array and the pressure sensor of the opticaldetection device can be simultaneously applied for detection of theliquid matter. If the optical detection device detects the raised heightof the injected liquid matter and the increased weight of the targetcontainer, the injected liquid matter may be dark or opaque as coffee,so the optical sensor array can be actuated to detect the correct heightof the injected liquid matter. If the optical detection device detectsthe increased weight of the target container, but does not detect theraised height of the injected liquid matter or detects slow rise ornonlinear rise of the height of the injected liquid matter, the injectedliquid matter may be light or transparent as water, and the pressuresensor can be actuated for helping the optical sensor array to acquirethe correct height of the injected liquid matter. The optical detectiondevice of the present invention can be installed on the water dispenseror the coffee maker, and can rapidly and correctly compute the height ofthe injected liquid matter in the target container, so as to effectivelyestimate discharge capacity of the water dispenser and the coffee maker,and to prevent the injected liquid matter from leakage.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a functional block diagram of an optical detection deviceaccording to an embodiment of the present invention.

FIG. 2 is a schematic diagram of the optical detection device accordingto the embodiment of the present invention.

FIG. 3 and FIG. 4 are diagrams of a linear light source according todifferent embodiments of the present invention.

FIG. 5 is an enlarged diagram of a part of the optical detection deviceand a target container according to the embodiment of the presentinvention.

FIG. 6 is a diagram of an image captured by an optical sensor arrayaccording to the embodiment of the present invention.

FIG. 7 is a diagram of a distribution curve transformed form the imageaccording to the embodiment of the present invention.

FIG. 8 is a diagram of the optical detection device and the targetcontainer in a detection mode according to another embodiment of thepresent invention.

FIG. 9 and FIG. 10 are diagrams of the optical detection deviceaccording to other embodiments of the present invention.

FIG. 11 is a functional block diagram of an optical detection deviceaccording to another embodiment of the present invention.

FIG. 12 is a diagram of an image captured by the optical detectiondevice according to the foresaid embodiment of the present invention.

FIG. 13 is a diagram of a distribution curve transformed form the imageaccording to the foresaid embodiment of the present invention.

FIG. 14 is a diagram of the optical detection device and the targetcontainer according to the foresaid embodiment of the present invention.

FIG. 15 and FIG. 16 are diagrams of images about different liquid mattercaptured by the optical sensor array according to the embodiment of thepresent invention.

FIG. 17 is a diagram of the distribution curve transformed form theimage according to another embodiment of the present invention.

FIG. 18 is a functional block diagram of an optical detection deviceaccording to another embodiment of the present invention.

FIG. 19 and FIG. 20 are diagrams of the target container detected by theoptical detection device according to another embodiment of the presentinvention.

DETAILED DESCRIPTION

Please refer to FIG. 1 and FIG. 2 . FIG. 1 is a functional block diagramof an optical detection device 10 according to an embodiment of thepresent invention. FIG. 2 is a schematic diagram of the opticaldetection device 10 according to the embodiment of the presentinvention. The optical detection device 10 can be applied to a waterdispenser or a coffee maker. The optical detection device 10 can detectnot only existence of a target container 12, but also a size of thetarget container 12 and a height of injected liquid matter in the targetcontainer 12. The optical detection device 10 can include a linear lightsource 14, an optical sensor array 16, a memory 18 and a processor 20.The linear light source 14, the optical sensor array 16 and the memory18 can be electrically connected to the processor 20. The memory 18 canbe an optional unit in the optical detection device 10.

Please refer to FIG. 3 and FIG. 4 . FIG. 3 and FIG. 4 are diagrams ofthe linear light source 14 according to different embodiments of thepresent invention. As shown in FIG. 3 , the linear light source 14 caninclude one strip-formed lighting unit 141 used to generate and projecta long strip illumination beam onto the target container 12. As shown inFIG. 4 , the linear light source 14 can include a plurality of lightingunits 142 arranged side by side, and the plurality of lighting units 142respectively emit a small size beam to form the long strip illuminationbeam projected onto the target container 12. A length of the long stripillumination beam can be preferably greater than a size of the targetcontainer 12, which means the long strip illumination beam can beprojected onto the target container 12 and a plane S whereon the targetcontainer 12 is located simultaneously.

The optical sensor array 16 can include a plurality of sensing units 161arranged as a long strip for receiving a long strip detection beam. Theoptical sensor array 16 may be a M×1 matrix to match with a shape of thelong strip detection beam, and M is a positive integer numeral; further,the optical sensor array 16 may be a M×N matrix, and M and N arepositive integer numerals. An amount of the sensing units 161 depends ona detection area on the plane S for the target container 12, which meansthe amount of the sensing units 161 is increased in response to a sizeof the detection area, so as to broaden detection ability of the opticalsensor array 16. The optical sensor array 16 can receive the long stripdetection beam reflected from the target container 12 in response toprojection of the long strip illumination beam. The processor 20 cananalyze intensity distribution generated by the plurality of sensingunits 161 to acquire a relative distance between the optical sensorarray 16 and the target container 12. The relative distance can betransformed into the size of the target container 12, and the height ofthe injected liquid matter in the target container 12.

Please refer to FIG. 5 to FIG. 7 . FIG. 5 is an enlarged diagram of apart of the optical detection device 10 and the target container 12according to the embodiment of the present invention. FIG. 6 is adiagram of an image I captured by the optical sensor array 16 accordingto the embodiment of the present invention. FIG. 7 is a diagram of adistribution curve C transformed form the image I according to theembodiment of the present invention. In one possible embodiment, whenthe optical sensor array 16 receives the long strip detection beam B,the optical detection device 10 can divide the long strip detection beamB into several segments B1˜Bn, which are respectively projected onto aplurality of sections S1˜Sn of the target container 12 (and/or the planeS). Each segment can be analyzed to compute the relative distancebetween each sensing unit 161 of the optical sensor array 16 and onecorresponding section of the target container 12 (and/or the plane S);then, a plurality of the relative distance computed by the segmentsB1˜Bn can be transformed into a contour of the target container 12 andthe plane S.

As shown in FIG. 5 , the target container 12 has an opening 121, and theliquid matter can be injected into the target container 12 via theopening 121. The opening 121 is surrounded by a rim 122 of the targetcontainer 12 and oriented to the optical sensor array 16, so that theoptical sensor array 16 can capture the image I containing a patternabout inside and outside of the opening 121. When the linear lightsource 14 emits the long strip illumination beam, the rim 122 of thetarget container 12, the liquid matter inside the opening 121 of thetarget container 12, and the plane S whereon the target container 12 islocated can reflect and generate the long strip detection beam B, whichcan be received by the optical sensor array 16. The optical detectiondevice 10 can acquire the relative distance between the optical sensorarray 16 and the rim 122 of the target container 12 and a liquid surfaceinside the opening 121, and the relative distance between the opticalsensor array 16 and the plane S.

The long strip detection beam B can be divided into the plurality ofsegments B1˜Bn, which are respectively reflected from the plurality ofsections S1˜Sn of the target container 12 and the plane S, and arerespectively received by the plurality of sensing units 161 of theoptical sensor array 16. The optical detection device 10 can analyze allintensity of the plurality of segments B1˜Bn received by the sensingunits 161, to acquire intensity variation of the long strip detectionbeam B. As shown in FIG. 7 , the segment which has high intensity canrepresent a short relative distance between the optical sensor array 16and the related section, such as a wave peak in the distribution curveC; the segment which has low intensity can represent a long relativedistance between the optical sensor array 16 and the related section,such as a wave trough in the distribution curve C. Thus, distancevariation of the optical sensor array 16 relative to the plurality ofsections S1˜Sn can be computed to draw the contour about those sectionsS1˜Sn.

The distribution curve C can be classified according to the intensitycomputed value of all the plurality of segments B1˜Bn. The saidintensity computed value can be an intensity mean value or an intensitymedian value within one region of the distribution curve C, whichdepends on a design demand. For example, the distribution curve C can bedivided into at least two regions, such as a first region R1 and asecond region R2. The first region R1 can have a maximal intensitycomputed value, and can be represented as the rim 122 of the targetcontainer 12. The second region R2 can have a minimal intensity computedvalue, and can be represented as the plane S. The optical detectiondevice 10 can compute a height of the target container 12 via heightdifference between the rim 122 and the plane S in response to analysisof the first region R1 and the second region R2.

In addition, the distribution curve C may be divided into three regions,such as the first region R1, the second region R2 and a third region R3.The third region R3 can have an intensity computed value ranged betweenthe maximal intensity computed value and the minimal intensity computedvalue. The third region R3 can be located within the wave peaks of thefirst region R1, and can be represented as a base inside the targetcontainer 12. If the target container 12 is empty, the said baserepresents a bottle bottom of the target container 12; if the targetcontainer 12 has the liquid matter, the said base represents the liquidsurface in the target container 12. The optical detection device 10 cananalyze difference between the first region R1, the second region R2 andthe third region R3, and utilize height difference between the rim 122and the base of the target container 12 to determine a residual capacityof the target container 12 in a situation of the height of the targetcontainer 12 being known.

As shown in FIG. 5 , the first region R1 of the distribution curve Ccontains two wave peaks, which can indicate two opposite sections of therim 122 of the target container 12. Because a pixel number of theoptical sensor array 16 is known, the size of the detection area on theplane S (for putting the target container 12) covered by the opticalsensor array 16 can be known, so the optical detection device 10 canutilize a pixel number about an interval between the two wave peaks ofthe first region R1, and/or another pixel number about another intervalbetween each wave peak and a corresponding boundary of the image I, toestimate the distance between the two opposite sections of the rim 122(which means the distance between the two wave peaks), so as to acquirea diameter of the target container 12 (such as the size of the opening121).

Besides, surface tension may be generated between the liquid matter andan inner wall of the target container 12, which results in the liquidmatter within the place having optical parameters different from theoptical parameters of the liquid matter within other place. The opticalparameters may be a reflective index. The optical detection device 10can analyze intensity difference between the sections S1˜Sn relative tothe long strip detection beam B, to find out the sections Sa and Sb withunusual optical parameters, and define the sections Sa and Sb as thebase of the target container 12, such like a surface of the liquidmatter. Then, corresponding points Ca and Cb relevant to the sections Saand Sb can be checked on the distribution curve C, and the residualcapacity of the target container 12 can be computed in accordance withheight difference between the rim 122 and the base of the targetcontainer 12, or difference between height of the optical sensor array16 relative to the plane S and height of the optical sensor array 16relative to the base of the target container 12.

The optical detection device 10 further can store the optical parametersof the known liquid matter into the memory 18. The known liquid mattermay be water, coffee or soda drinks. The optical parameters may be agroup consisted of the reflective index, a refractive index and anabsorption rate. If the coffee is injected into the target container 12,reflection intensity of the long strip detection beam B is high, so theoptical detection device 10 can detect the correct height of theinjected liquid matter in the target container 12. If the water isinjected into the target container 12, the reflection intensity of thelong strip detection beam B is low, and the height of the injectedliquid matter in the target container 12 detected by the opticaldetection device 10 has noise; therefore, the optical detection device10 can utilize the optical parameters pre-stored in the memory 18 tocompensate an analysis result of the intensity distribution, so as tocorrectly compute the relative distance between the optical sensor array16 and the liquid matter inside the target container 12, for acquiringthe correct height of the injected liquid matter in the target container12.

Further, the memory 18 may store geometric center information of theknown liquid matter, and the optical detection device 10 can analyze theintensity distribution acquired by the optical sensor array 16 toidentify a category of the liquid matter. Please refer to FIG. 15 andFIG. 16 . FIG. 15 and FIG. 16 are diagrams of images I1 and I2 aboutdifferent liquid matter captured by the optical sensor array 16according to the embodiment of the present invention. As shown in FIG.15 , the image I1 shows the target container 12 accommodates the darkliquid matter, such as coffee, so that high intensity regions inside theopening 121 are adjacent to the rim 122. As shown in FIG. 16 , the imageI2 shows the target container 12 accommodates the transparent liquidmatter, such as water, and low intensity regions inside the opening 121are adjacent to the rim 122 and on center of the opening 121. Thus, theoptical detection device 10 can analyze the geometric center informationinside the images I1 and I2, and determine what value range of theoptical parameters corresponds to the detected geometric centerinformation according to stored information of the memory 18, so as toensure a category of the liquid matter in the target container 12, suchas coffee with the low reflective index or water with the highreflective index. The geometric center information may be a center ofmass, a center of form, or a center of gravity, which depends on theactual demand.

Please refer to FIG. 7 and FIG. 17 . FIG. 17 is a diagram of thedistribution curve C′ transformed form the image I′ according to anotherembodiment of the present invention. As shown in FIG. 7 , the thirdregion R3 within the distribution curve C is smooth, which means theliquid matter inside the target container 12 has a flat top surface; asshown in FIG. 17 , the third region R3 within the distribution curve C′is uneven, so that the target container 12 has something in the liquidmatter. The optical detection device 10 can analyze the distributioncurve C and C′ to acquire the contour resulted from the intensitydistribution of the sections S1˜Sn, so as to show depth variationinformation inside the rim 122. If the depth variation informationinside the rim 122 has small change, the target container 12 mayaccommodate the liquid matter; if the depth variation information insidethe rim 122 has huge change, the target container 12 may accommodate theliquid matter and an extra object. The extra object can be a driftedthing, such as an ice cube or a sugar cube; or the extra object can benot the drifted thing, such as a spoon.

Please refer to FIG. 6 and FIG. 8 . FIG. 8 is a diagram of the opticaldetection device 10 and the target container 12 in a detection modeaccording to another embodiment of the present invention. In anotherpossible embodiment, after receiving the image I, the optical detectiondevice 10 may distinguish the rim 122 of the target container 12 fromthe plane S in the image I; for example, the first region R1 with themaximal intensity computed value can be represented as the rim 122, andthe second region R2 with the minimal intensity computed value can berepresented as the plane S. Then, the optical detection device 10 candefine an alignment point P within a range around the rim 122, and thealignment point P can be a vertically projected point from the opticalsensor array 16 onto a surface of the rim 122.

A field interval between the alignment point P and the left of the rim122 can be defined as a first distance D1, and another field intervalbetween the alignment point P and the right of the rim 122 can bedefined as a second distance D2. If the optical detection device 10 doesnot point a center of the target container 12, the first distance D1 isdifferent from the second distance D2. As the alignment point P isdefined, the optical detection device 10 can acquire an angle value FOVabout the field of view of the optical sensor array 16 from the memory18, and compute a third distance D3 from the optical sensor array 16 tothe alignment point P of the rim 122, and then utilize angle value FOVand the third distance D3 to compute a first gap G1 between thealignment point P and a left side of the field of view, or between thealignment point P and a right side of the field of view viatrigonometric functions. The embodiment computes the first gap G1between the alignment point P and the left side of the field of view,such as formula 1.

$\begin{matrix}{{G\; 1} = {D\; 3 \times {\tan\left( \frac{FOV}{2} \right)}}} & {{Formula}\mspace{14mu} 1}\end{matrix}$

Then, the optical detection device 10 can acquire a first pixel numberN1 of an interval from the alignment point P to the left of the rim 122in the image I, and a second pixel number N2 of another interval fromthe alignment point P to the right of the rim 122 in the image I, and athird pixel number N3 of another interval from the alignment point P tothe left side of the field of view. The optical detection device 10 canutilize the first gap G1, the first pixel number N1 and the third pixelnumber N3 to compute the first distance D1, such as formula 2, andfurther can utilize the first gap G1, the second pixel number N2 and thethird pixel number N3 to compute the second distance D2, such as formula3. The diameter of the opening 121 of the target container 12, whichmeans the interval between the left side and the right side of the rim122, can be a sum of the first distance D1 and the second distance D2.

$\begin{matrix}{{D\; 1} = {G\; 1 \times \frac{N\; 1}{N\; 3}}} & {{Formula}\mspace{14mu} 2} \\{{D\; 2} = {G\; 1 \times \frac{N\; 2}{N\; 3}}} & {{Formula}\mspace{14mu} 3}\end{matrix}$

When the existence of the target container 12 is detected and the heightand the diameter of the target container 12 are computed, the opticaldetection device 10 may further utilize a pressure sensor 22 to detect aweight of the target container 12 and the injected liquid matter. Thepressure sensor 22 can be disposed on the plane S and electricallyconnected to the processor 20. As the target container 12 is just put onthe plane S, the liquid matter is not injected into the target container12, and the pressure sensor 22 can detect and acquire an empty weight ofthe target container 12. As the liquid matter is injected into thetarget container 12, the pressure sensor 22 can detect and acquire anincreased weight of the injected liquid matter. Because the opticaldetection device 10 can be installed on the known water dispenser or theknown coffee maker, property parameters (such as density) of the liquidmatter can be pre-stored in the memory 18. Thus, the optical detectiondevice 10 can analyze the diameter Dt of the target container 12, thedensity Dw of the liquid matter, and the increased weight W1 of theinjected liquid matter to compute the height Hl of the injected liquidmatter in the target container 12, such as formula 4.

$\begin{matrix}{{H\; 1} = \frac{W\; 1}{{Dt} \times {Dw}}} & {{Formula}\mspace{14mu} 4}\end{matrix}$

Please refer to FIG. 9 and FIG. 10 . FIG. 9 and FIG. 10 are diagrams ofthe optical detection device 10′ and 10″ according to other embodimentsof the present invention. In the embodiments, elements having the samenumerals as ones of the foresaid embodiment have the same structures andfunctions, and a detailed description is omitted herein for simplicity.As the embodiment shown in FIG. 9 , the optical detection device 10′ canfurther include a rotation motor 24, and the rotation motor 24 can holdthe linear light source 14 or a supporter of the target container 12.The rotation motor 24 can be disposed at least one of the linear lightsource 14 and the supporter of the target container 12. The supporter isan element disposed on the plane S for holding the target container 12and not shown in the figures. The rotation motor 24 can rotate thelinear light source 14 or the target container 12, so that the longstrip illumination beam and the long strip detection beam can fully scanall aspects of the target container 12. As the embodiment shown in FIG.10 , the optical detection device 10″ can further include a shiftingmotor 26 used to hold at least one of the linear light source 14 and thesupporter of the target container 12, so as to shift the linear lightsource 14 or the target container 12 for fully scanning the targetcontainer 12.

Please refer to FIG. 11 to FIG. 14 . FIG. 11 is a functional blockdiagram of an optical detection device 10A according to anotherembodiment of the present invention. FIG. 12 is a diagram of an image I′captured by the optical detection device 10A according to the foresaidembodiment of the present invention. FIG. 13 is a diagram of adistribution curve C′ transformed form the image I′ according to theforesaid embodiment of the present invention. FIG. 14 is a diagram ofthe optical detection device 10A and the target container 12 accordingto the foresaid embodiment of the present invention. The opticaldetection device 10A can detect the dimensions of the target container12. The optical detection device 10A can include a light source 14A, anoptical sensor array 16A and a processor 20A. The optical detectiondevice 10A may optionally include a memory module, which has a functionthe same as ones of the above-mentioned embodiment, and a detaileddescription can be omitted herein for simplicity.

The light source 14A may be the linear light source adapted to projectthe long strip illumination beam onto the target container 12, or be aspot light source adapted to project a dispersed illumination beam ontothe target container 12. The optical sensor array 16A can receive thedetection beam reflected from the target container 12. A type of thedetection beam can correspond to a type of the illumination beamprojected by the light source 14A.

The processor 20A can be electrically connected to the optical sensorarray 16A. The processor 20A can analyze intensity distribution of thedetection beam to find out at least two regions with specific intensity,and then compute a radial dimension of the target container 12 accordingto an interval between the specific intensity regions. For example, ifthe light source 14A is the spot light source and the target container12 is a round shape cup, the image I′ captured by the optical detectiondevice 10A can contain a round shape pattern. Because an intervalbetween the optical detection device 10A and the cup rim A1 of thetarget container 12 is short, and a plurality of reflection pointsP1-1˜P1-n with specific intensity (which means the foresaid specificintensity regions) which is arranged as the round shape can be generatedvia scattering function when the detection beam generated by the opticaldetection device 10A is projected into the cup rim A1 of the targetcontainer 12. The processor 20A can analyze relative position of thereflection points P1-1˜P1-n to acquire a width W1 (which means theradial dimension) of the target container 12.

If the light source 14A is the linear light source and the targetcontainer 12 is the round shape cup, the distribution curve transformedfrom the image, which is captured by the optical detection device 10A,can have at least two reflection points (which are not shown in thefigures) with the specific intensity due to the detection beam beingscattered on a left side and a right side of the cup rim A1 of thetarget container 12. The processor 20A can analyze an interval betweenthe two reflection points to acquire the width W1 (which means theradial dimension) of the target container 12.

As shown in FIG. 12 to FIG. 14 , the image I′ can have the outer roundshape pattern with large radial dimensions and the inner shape patternwith small radial dimensions. The outer round shape pattern can be madeby the plurality of reflection points P1-1˜P1-n with first intensity,and can represent the width W1 of the target container 12 in a firstheight, such as position of the cup rim A1. The smaller inner shapepattern can be made by a plurality of reflection points P2-1˜P2-n withsecond intensity. If the target container 12 does not contain the liquidmatter, the detection beam of the light source 14A can be scattered bythe cup bottom A2 of the target container 12 to generate the reflectionpoints P2-1˜P2-n; if the target container 12 contains the liquid matter,the detection beam of the light source 14A can be scattered by theliquid surface A3 inside the target container 12 to generate thereflection points P2-1˜P2-n. The processor 20A can analyze relativeposition of the reflection points P2-1˜P2-n to acquire the width W2 ofthe cup bottom A2 or the liquid surface A3 of the target container 12.

The reflection points P2-1˜P2-n can represent the width W2 of the targetcontainer 12 in a second height (such as position of the cup bottom A2or the liquid surface A3). An interval between the optical detectiondevice 10A and the cup bottom A2 (or the liquid surface A3) is longerthan the interval between the optical detection device 10A and the cuprim A1 of the target container 12, so that the second intensity of thereflection points P2-1˜P2-n can be greater than reflection intensity ofa cup wall of the target container 12, and smaller than the firstintensity of the reflection points P1-1˜P1-n around the cup rim A1.Thus, the processor 20A can analyze the outer round shape pattern andthe inner shape pattern within the image I′ and/or the correspondingdistribution curve C′, to rapidly identify the position and width of thecup rim A1, the cup bottom A2 and the liquid surface A3 of the targetcontainer 12.

Please refer to FIG. 18 to FIG. 20 . FIG. 18 is a functional blockdiagram of an optical detection device 10B according to anotherembodiment of the present invention. FIG. 19 and FIG. 20 are diagrams ofthe target container 12 detected by the optical detection device 10Baccording to another embodiment of the present invention. The opticaldetection device 10B can include a first linear light source 30, asecond linear light source 32, an optical sensor array 34 and aprocessor 36. The first linear light source 30 and the second linearlight source 32 can project a first long strip illumination beam and asecond long strip illumination beam respectively onto the targetcontainer 12, and a first long strip detection beam and a second longstrip detection beam can be reflected from the target container 12 andthe plane S for being received by the optical sensor array 34. Eachsegment of the first long strip detection beam are respectivelyreflected from a plurality of sections S11˜S1_n of the target container12 and/or the plane S. Each segment of the second long strip detectionbeam are respectively reflected from a plurality of sections S21˜S2_n ofthe target container 12 and/or the plane S.

The optical sensor array 34 can be the M×N matrix, and M and N arepositive integer numerals; the actual application of the matrix is notlimited to the foresaid embodiment. The processor 36 can be electricallyconnected to the optical sensor array 34. The processor 36 can analyzethe intensity distribution of the first long strip detection beam andthe second long strip detection beam from the target container 12 and/orthe plane S, to acquire the relative distance between the optical sensorarray 34 and the target container 12. Two intersection points Pi_1 andPi_2 can be formed by the first long strip detection beam and the rim122 of the target container 12. Two intersection points Pi_3 and Pi_4can be formed by the second long strip detection beam and the rim 122 ofthe target container 12. The processor 36 can compute an intervalbetween the intersection points Pi_1 and Pi_2 and an interval betweenthe intersection points Pi_3 and Pi_4, so as to accordingly determinethe relative distance between the optical sensor array 34 and the targetcontainer 12.

As shown in FIG. 19 , the interval between the intersection points Pi_1and Pi_2 is greater than the interval between the intersection pointsPi_3 and Pi_4, and the intersection points Pi_3 and Pi_4 are much closeto the intersection point Pi_2 instead of the intersection point Pi_1,so that the target container 12 can be determined as not correctlylocating under the optical sensor array 34. As shown in FIG. 20 , theinterval between the intersection points Pi_1 and Pi_2 is the same as orsimilar to the interval between the intersection points Pi_3 and Pi_4,and the intersection points Pi_3 and Pi_4 are in middle between theintersection points Pi_1 and Pi_2, so the target container 12 can bedetermined as correctly locating under the optical sensor array 34. Theoptical detection device 10B can output a corresponding reminder messageaccording to the foresaid determination result, such as reminder ofadjusting position of the target container 12, and the water dispenseror the coffee maker can inject the liquid matter into the targetcontainer 12 without leakage.

The optical detection device of the present invention can utilize theimage about the target container and the plane illuminated by the linearlight source or the spot light source to determine the height and thediameter of the target container. If the optical parameters (such as thereflective index, the refractive index and the absorption rate) of theliquid matter in the target container are known, the optical parameterscan be utilized to compensate and compute the correct height of theinjected liquid matter in the target container. Moreover, the opticaldetection device may utilize the pressure sensor to detect the increasedweight of the injected liquid matter in the target container, and thenutilize pixel numbers of the optical sensor array and the height of theoptical sensor array relative to the rim of the target container toacquire the diameter of the target container, so as to compute theheight of the injected liquid matter in the target container viaanalysis of the increased weight and the density of the injected liquidmatter and the diameter of the target container.

In conclusion, the optical sensor array and the pressure sensor of theoptical detection device can be simultaneously applied for detection ofthe liquid matter. If the optical detection device detects the raisedheight of the injected liquid matter and the increased weight of thetarget container, the injected liquid matter may be dark or opaque ascoffee, so the optical sensor array can be actuated to detect thecorrect height of the injected liquid matter. If the optical detectiondevice detects the increased weight of the target container, but doesnot detect the raised height of the injected liquid matter or detectsslow rise or nonlinear rise of the height of the injected liquid matter,the injected liquid matter may be light or transparent as water, and thepressure sensor can be actuated for helping the optical sensor array toacquire the correct height of the injected liquid matter. Comparing tothe prior art, the optical detection device of the present invention canbe installed on the water dispenser or the coffee maker, and can rapidlyand correctly compute the height of the injected liquid matter in thetarget container, so as to effectively estimate discharge capacity ofthe water dispenser and the coffee maker, and to prevent the injectedliquid matter from leakage.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. An optical detection device of detecting a target container, the optical detection device comprising: a linear light source adapted to project a long strip illumination beam onto the target container; an optical sensor array, comprising a plurality of sensing units arranged as a long strip adapted to receive a long strip detection beam reflected from the target container; and a processor electrically connected to the optical sensor array, the processor being adapted to analyze intensity distribution of the plurality of sensing units to acquire a relative distance between the optical sensor array and a rim of the target container, and further to acquire depth variation information inside the rim.
 2. The optical detection device of claim 1, wherein the long strip detection beam is divided into a plurality of segments respectively reflected from a plurality of sections of the target container and received by the plurality of sensing units, the processor further analyzes intensity of the plurality of segments to compute distance variation of the optical sensor array relative to the plurality of sections for acquiring a contour about the plurality of sections.
 3. The optical detection device of claim 2, wherein the processor further analyzes the contour about the plurality of sections and determines whether an extra object is in liquid matter inside the target container according to the depth variation information.
 4. The optical detection device of claim 2, wherein the distance variation represents a plurality of relative distances between each section and one corresponding sensing unit.
 5. The optical detection device of claim 2, wherein the processor divides the intensity distribution at least into a first region with a maximal intensity computed value and a second region with a minimal intensity computed value, and analyzes the first region and the second region to determine a height of the target container via height difference between the rim and a plane whereon the target container is located.
 6. The optical detection device of claim 5, wherein the processor further divides the intensity distribution into the first region, the second region and a third region with an intensity computed value ranged between the maximal intensity computed value and the minimal intensity computed value, and the processor further analyzes the third region to determine a residual capacity of the target container via height difference between the rim and a base of the target container.
 7. The optical detection device of claim 2, wherein the processor further analyzes intensity difference between the plurality of sections to find out one or some sections with unusual optical parameters, defines the sections with the unusual optical parameters as a base of the target container, and utilizes the sections with the unusual optical parameters to determine a residual capacity of the target container.
 8. The optical detection device of claim 1, further comprising: a memory electrically connected to the processor and adapted to store optical parameters of liquid matter, the processor being further adapted to compute a relative distance between the optical sensor array and the liquid matter inside the target container via analysis of the intensity distribution and compensation of the optical parameters.
 9. The optical detection device of claim 8, wherein the processor further analyzes image transformed by the intensity distribution to determine a value range of the optical parameters via geometric center information of the image, for ensuring a category of the liquid matter.
 10. The optical detection device of claim 8, wherein the optical parameters are a group consisted of a reflective index, a refractive index and an absorption rate.
 11. The optical detection device of claim 8, wherein an opening of the target container is surrounded by the rim and oriented to the optical sensor array, the liquid matter is accommodated inside the target container and exposed via the opening.
 12. The optical detection device of claim 1, wherein the processor further distinguishes the rim from a base of the target container, and computes a diameter of the rim via the relative distance between the optical sensor array and the rim.
 13. The optical detection device of claim 12, wherein an alignment point is a vertically projected point from the optical sensor array onto a surface of the rim, the processor analyzes a field of view of the optical sensor array to acquire a field interval between the alignment point and a boundary of the field of view, and utilizes the field interval to compute a rim interval between the alignment point and the rim so as to accordingly acquire the diameter.
 14. The optical detection device of claim 12, further comprising: a pressure sensor electrically connected to the processor and adapted to detect a weight of the target container.
 15. The optical detection device of claim 14, wherein the processor analyzes relation between the diameter and density and weight of liquid matter inside the target container, to acquire a height of the liquid matter.
 16. The optical detection device of claim 14, wherein the processor utilizes the optical sensor array to detect a height of liquid matter inside the target container when the weight is increased and the height of the liquid matter is raised, and further utilizes the pressure sensor and the optical sensor array to detect the height of the liquid matter when the weight is increased but the height of the liquid matter is constant.
 17. The optical detection device of claim 1, wherein the linear light source comprises one strip-formed lighting unit adapted to generate the long strip illumination beam.
 18. The optical detection device of claim 1, wherein the linear light source comprises a plurality of lighting units arranged side by side and adapted to generate the long strip illumination beam.
 19. The optical detection device of claim 1, wherein the optical sensor array is a M×1 matrix and M is a positive integer numeral, or a M×N matrix and M and N are positive integer numerals.
 20. The optical detection device of claim 1, further comprising: a rotation motor adapted to hold and rotate the linear light source or the target container for scanning the target container.
 21. The optical detection device of claim 1, further comprising: a shifting motor adapted to hold and shift the linear light source or the target container for scanning the target container. 